/*
 * @Author: 许旺玉
 * @Description: 用户 -> 收货地址接口
 * @Date: 2020-06-28 13:56:18
 * @LastEditTime: 2020-07-03 16:23:31
 * @LastEditors: 範遠茂
 */ 

import { ajaxGet,ajaxPost,ajaxPut,ajaxDel} from '@/utlis/request.js'

export function get_address(params) {  //获取用户地址列表
    const url = 'user/address'
    return ajaxGet(url, params)
}

export function post_Address(data) { //添加收货地址
    const url = 'user/address'
    return ajaxPost(url, data)
}

export function get_address_detail(params) {  //收货地址详情
    const url = `user/address/${params}`
    return ajaxGet(url)
}

export function modify_address(id,data) { //修改收货地址
    console.log(id)
    const url = `user/address/${id}`
    return ajaxPut(url,data)
}


export function ajaxdel(params) {  //删除收货地址
    const url = 'user/address'
    return ajaxDel(url, params)
}



export function default_address(data) { //设置默认收货地址
    const url = `user/address/default/${data}`
    return ajaxPut(url)
}
